<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<div id="app">
    <p>{{foo}}</p>
    <button v-on:click="foo = 'baz'">Change it</button>
</div>
<script src="https://cdn.jsdelivr.net/npm/vue@2/dist/vue.js"></script>
<script>
    var data = {a:1}
    var vm = new Vue({
        el:"example",
        data:data
    })
    vm.$data ===data// =>true
    vm.$el === document.getElementById("example")//=>true
    vm.$watch('a',function (newValue, oldValue) {
        //这个回调会在vm.a改变后调用
    })

    var obj = {
        foo:'bar'
    }
    Object.freeze(obj)
    new Vue({
        el:"#app",
        data:obj
    })

</script>
</body>
</html>